export function getUrlParams(url: string): any {
  if (!url || url.indexOf('?') <= 0) {
    return;
  }
  url = `{"${url.replace(/^[^?]*[?]/g, '').replace(/[=]/g, '": "').replace(/[&]/g, '", "')}"}`;
  return eval(`(${url})`);
}

export function getBodyParams(body: string) {
  if (!body) {
    return {}
  }
  return eval(`(${body})`);
}